#pragma once
#include <iostream>
#include "mem.h"
#include "disk.h"

namespace VirtualR {

class LSMTree {
 public:
  bool file_open(std::string file_dir);
  bool get(std::string key, std::string &value);
  bool put(std::string key, std::string value);
  bool del(std::string key);
  uint64_t get_mem_count() {
    if (mem_ != nullptr) {
      return mem_->get_entry_size();
    }
    return 0;
  }
 private:
  SkipList *mem_{nullptr};
  Disk *disk_{nullptr};
  uint64_t success_count_{0};
  uint64_t fail_count_{0};
};
} // namespace VirtualR